package com.learn.config;

import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;

/**
 * TODO: please加入描述
 * @author chenxin
 * @time 2016-10-24-11:10
 */
public class ConfigManager {
    public static void main(String[] args) throws Exception{
        String filePath = "../../../../resources/config.properties";
        filePath = "/Users/chenxin/Documents/code/small-experiment/spring-test/src/main/resources/config.properties";
        PropertiesConfiguration conf = new PropertiesConfiguration(filePath);
        conf.setReloadingStrategy(new FileChangedReloadingStrategy());
        System.out.println("key a= " + conf.getString("a"));

        Thread.sleep(30000);

        System.out.println("key a= " + conf.getString("a"));
    }
}
